import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class OverLayFilerView {
  static OverlayEntry? overlayEntry;

  static void showView(BuildContext context) {
    overlayEntry = OverlayEntry(builder: (BuildContext context) {
      return GuideInfoView(
        overlayEntry: overlayEntry,
      );
    });
    Overlay.of(context).insert(overlayEntry!);
  }

  static void dismiss() {
    try {
      if (overlayEntry != null) {
        overlayEntry?.remove();
      }
    } catch (e) {
      print(e.toString());
    }
  }
}

class GuideInfoView extends StatefulWidget {
  OverlayEntry? overlayEntry;

  GuideInfoView({this.overlayEntry, super.key});

  @override
  State<GuideInfoView> createState() => _State();
}

class _State extends State<GuideInfoView> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        widget.overlayEntry?.remove();
      },
      child: Container(
        color: const Color.fromRGBO(0, 0, 0, 0.8),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
             SizedBox(
              height: 133.w,
            ),
             Image.asset('images/scan/scroll_filter_click.png',width: 183.w,height: 183.w,),
             SizedBox(
              height: 98.w,
            ),
             Image.asset('images/scan/scroll_filter_left.png',width: 183.w,height: 183.w,),
          ],
        ),
      ),
    );
  }

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }
}
